﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0047)http://ufxtract.com/testsuite/hcard/hcard7.htm -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>hCard 7 - extracting telephone number test</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-type><!-- This will be replace with one CSS file and one JavaScipt file --><LINK 
rel=stylesheet type=text/css href="tel_files/uftestsuite.css"><LINK 
rel=stylesheet type=text/css href="tel_files/testrunner.css">
<SCRIPT type=text/javascript src="tel_files/prototype-1.6.0.2.js"></SCRIPT>

<SCRIPT type=text/javascript src="tel_files/beautify.js"></SCRIPT>

<SCRIPT type=text/javascript src="tel_files/microformat.js"></SCRIPT>

<SCRIPT type=application/javascript;version=1.7 
src="tel_files/Microformats.js"></SCRIPT>

<SCRIPT type=text/javascript src="tel_files/testrunner.js"></SCRIPT>

<META name=GENERATOR content="MSHTML 8.00.6001.18812"></HEAD>
<BODY>
<DIV class=test-fixture>
<P><A href="http://ufxtract.com/testsuite/"><IMG id=testsuite-image border=0 
alt="Microformats test suite" src="tel_files/testsuite.gif"></A><BR></P>
<H1 class=summary>hCard 7 - extracting tel (telephone) number test</H1>
<P class=description>This page test that parsers can extract telephone numbers 
from different structures. This includes type property and value excerpting 
test. The IsEqualToPhoneNumber method <A 
href="http://ufxtract.com/testsuite/documentation/phone-number.htm">canonicalises 
and compares</A> phone numbers. </P>
<P>From: <A href="http://ufxtract.com/testsuite/hcard/default.htm"><SPAN 
class=format>hCard</SPAN> test suite 1.0</A></P>
<P class="author vcard">Author: <A class="url fn" 
href="http://www.glennjones.net/">Glenn Jones</A> </P><!--
    <p>Output examples: 
    <ul>
    <li class="output"><a class="url" href="hcard1.js"><span class="type">JSON</span></a></li>
    <li class="output"><a class="url" href="hcard1.xml"><span class="type">XML</span></a></li>
    </ul>
    </p>
    -->
<P>Tests:</P>
<TABLE id=assetTable cellSpacing=0 cellPadding=0>
  <THEAD>
  <TR>
    <TH>Test</TH>
    <TH>Result</TH>
    <TH>Comment</TH></TR></THEAD>
  <TBODY>
  <TR class=assert>
    <TD class=test>vcard[0].tel[0].value</TD>
    <TD class=result>IsEqualTo("01273 700100")</TD>
    <TD class=comment>Should collect the telephone number from the node 
  text</TD></TR>
  <TR class=assert>
    <TD class=test>vcard[1].tel[0].value</TD>
    <TD class=result>IsEqualToPhoneNumber("01273 700100")</TD>
    <TD class=comment>Should collect the telephone number from a descendant 
      node with value property</TD></TR>
  <TR class=assert>
    <TD class=test>vcard[2].tel[0].type[11]</TD>
    <TD class=result>IsEqualToCaseInsensitive("PCS")</TD>
    <TD class=comment>Should find the type value. Types are case 
  insensitive</TD></TR>
  <TR class=assert>
    <TD class=test>vcard[3].tel[0].type[1]</TD>
    <TD class=result>HasProperty(false)</TD>
    <TD class=comment>The second type value "next-door" is incorrect</TD></TR>
  <TR class=assert>
    <TD class=test>vcard[4].tel[0].value</TD>
    <TD class=result>IsEqualToPhoneNumber("01273 700301")</TD>
    <TD class=comment>Where a type is specified, but the value is not then the 
      node text is the value</TD></TR></TBODY></TABLE>
<P>History:</P>
<UL>
  <LI class="history vevent"><SPAN class=summary>Created</SPAN>: <ABBR 
  class=dtstart title=2008-05-10>10 May 2008</ABBR> <SPAN class=description>by 
  Glenn Jones</SPAN> </LI>
  <LI class="history vevent"><SPAN class=summary>Updated</SPAN>: <ABBR 
  class=dtstart title=2008-05-14>14 May 2008</ABBR> <SPAN class=description>by 
  Glenn Jones - Added any additional test and example hCard 4. Changed the type 
  values to match hCard specification invalid removing "video" and adding "pcs". 
  Remove the test where email had atype but no value.</SPAN> </LI></UL></DIV>
<DIV id=uf><!-- This may not be the best semantic use of HTML element --><!-- 0 -->
<P class=vcard><SPAN class=fn>John Doe</SPAN> - <SPAN class=tel>01273 
700100</SPAN>: </P><!-- 1 -->
<P class=vcard><SPAN class=fn>John Doe</SPAN> - <SPAN class=tel><SPAN 
class=type>pref</SPAN>erred: <SPAN class=value>01273 700100</SPAN> </SPAN></P><!-- 2 -->
<DIV class=vcard><SPAN class=fn>John Doe</SPAN> - 
<DIV class=tel><SPAN class=type>home</SPAN>, <SPAN class=type>work</SPAN>, <SPAN 
class=type>pref</SPAN>, <SPAN class=type>voice</SPAN>, <SPAN 
class=type>fax</SPAN>, <SPAN class=type>msg</SPAN>, <SPAN 
class=type>cell</SPAN>, <SPAN class=type>pager</SPAN>, <SPAN 
class=type>bbs</SPAN>, <SPAN class=type>modem</SPAN>, <SPAN 
class=type>car</SPAN>, <SPAN class=type>isdn</SPAN> and <SPAN 
class=type>pcs</SPAN> <SPAN class=value>01273 700100</SPAN> </DIV>
<DIV class=tel><SPAN class=type>home</SPAN>: <SPAN class=value>01273 
700200</SPAN> </DIV></DIV><!-- 3 -->
<DIV class=vcard><SPAN class=fn>John Doe</SPAN> - <SPAN class=tel><SPAN 
class=type>home</SPAN> <SPAN class=type>next-door</SPAN> <SPAN class=value>01273 
700101</SPAN> </SPAN></DIV><!-- 4 -->
<DIV class=vcard><SPAN class=fn>John Doe</SPAN> - <SPAN class=tel><SPAN 
class=type>home</SPAN> 01273 700301</SPAN> </DIV></DIV>
<P><A href="http://ufxtract.com/testsuite/license.txt" rel=license>Some rights 
reserved</A> </P></BODY></HTML>
